#include <stdlib.h>
#include <stdio.h>
#include <string.h>
bool is_over(char *num){
	bool is_over = false;
	int take_over = 0;
	int num_lenght = strlen(num);
	for(int i = num_lenght - 1;i>=0;i-- ){
		int nSum = num[i] - '0' + take_over;
		if(i == num_lenght - 1) nSum++;
		if(nSum >= 10){
			if(i == 0) is_over = true;
			else{
				nSum -= 10;
				take_over = 1;
				num[i] = '0' + nSum;
			}
		}
		else{
			num[i] = '0' + nSum;
			break;
		}
	}
	return is_over;
}
void number_printf(char *num){
	bool is_begin = true;
	int num_len = strlen(num);
	for(int i = 0;i < num_len;i++){
		if(is_begin&&num[i]!='0') is_begin = false;
		if(!is_begin) printf("%c",num[i]);
	}
}
int main(void){
	int n = 12;
	char *c_number = (char*)malloc((n+1)*sizeof(char));
	for(int i = 0;i<n;i++){
		c_number[i] = '0'; 
	}
	c_number[n] = '\0';
	while(!is_over(c_number)){
		number_printf(c_number);
		printf(" ");
	}
	delete[] c_number;
} 
